<template>
  <div>
    <h3>电站审核</h3>
    <MySearch msg="搜索内容" :title="title" @getChildValue="getChildValue"></MySearch>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column fixed prop="shopName" label="充电站名称" width="150" />
      <el-table-column prop="tel" label="电话" width="120" />
      <el-table-column prop="address" label="地址" width="120" />
      <el-table-column fixed="right" label="Operations" width="120">
        <template #default>
          <el-button link type="primary" size="small" @click="handleClick">审核</el-button>
          <el-button link type="primary" size="small">驳回</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script lang='ts' setup>
import { findAllElecData } from "@/apis/shopApi"

const tableData = ref([])
const title = ref<string>("点击之前文本")
onMounted(() => {
  fetchData()
})
const fetchData = async () => {
  const res = await findAllElecData()
  console.log(res);
  tableData.value = res.data.rows

}
const handleClick = () => {
  console.log('click')
}
const getChildValue = (msg:string)=>{
  title.value = msg
}

</script>

<style lang='scss' scoped></style>